// 根据id获取元素
exports.$ = id => {
  return document.getElementById(id)
}

exports.formatDuration = time => {
  const minutes = '0' + Math.floor(time / 60)
  const seconds = '0' + Math.floor(time - minutes * 60)
  //截取后两位,例如"030",则截取"30";如果是"06",则依然截取"06"
  return minutes.slice(-2) + ':' + seconds.slice(-2)
}
